<!DOCTYPE html>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Language" content="zh-cn">
<title>购物车</title>
<meta name="description" content="">  
<meta name="keywords" content="">
<!--<link rel="shortcut icon" href="http://www.vmall.com/favicon.ico">-->
<link href="./Public/Home/css/ec.css" rel="stylesheet" type="text/css">
<link href="./Public/Home/css/cart.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="./Public/hdjs/hdjs.css"/>
<link rel="stylesheet" type="text/css" href="./Public/Home/css/ec.core.min.css"/>
<script src="./Public/Common/jquery-1.9.1.min.js" type="text/javascript"></script>
<!--[if lt IE 9]><script src="http://res9.vmallres.com/20160712/js/common/html5shiv.js"></script> <![endif]-->
<script src="./Public/hdjs/hdjs.min.js" type="text/javascript" charset="utf-8"></script>
</head>

<body class="wide sc">
<div class="top-banner" id="top-banner-block"></div>
<div class="shortcut">
    <div class="layout">
		<div class="s-sub">
			<ul>
				<li class="s-hw"><a href="index.php">返回商城</a></li>
			</ul>
		</div>
		<div class="s-main">
			<ul>
				<?php if(!isset($_SESSION['info'])){?>
                
				<li class="s-login" id="unlogin_status">
						<a href="<?php echo U('User/login')?>">登录</a>
						&nbsp;&nbsp;&nbsp;
                        <a href="<?php echo U('User/reg')?>">注册</a>
				</li>
                <?php }else{?>
				<li class="s-user" id="login_status">
					<div class="s-dropdown">
						<div class="h">
							<a href="<?php echo U('User/login')?>"><?php echo ($_SESSION['info']['username'])?></a>
							<a href="" id="customer_name" rel="nofollow" timetype="timestamp" class="link-user"></a>
						&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a href="<?php echo U('User/out')?>">退出</a></p>
						</div>
					</div>
				</li>
				<li class="s-myOrders">
					<a href="<?php echo U('Qzone/index')?>" rel="nofollow" timetype="timestamp">我的订单</a>
				</li>
				
				
               <?php }?>

				<li class="s-hwep hide" id="preferential"></li>
			</ul>
		</div>
		<!--顶部session判断登录结束-->
    </div>
</div>
<!--头部 -->
<div class="order-header">
	<div class="g">
    	<div class="fl">
            <div class="logo logo-index"><a href="index.php" title="华为商城"><img src="./Public/Home/image/newLogo.png" alt="华为商城"></a></div>
       </div>
        <div class="fr">
            <!--步骤条-三步骤 -->
            <div class="progress-area progress-area-3">
                <!--我的购物车 -->
                <div  style="display: block;"  id="progress-cart" class="progress-sc-area hide">我的购物车</div>
                <!--核对订单 -->
                <div id="progress-confirm" class="progress-co-area hide">填写核对订单信息</div>
                <!--成功提交订单 -->
                <div id="progress-submit" class="progress-sso-area hide">成功提交订单</div>
            </div>
        </div>
       
    </div>
</div>
<div class="layout">
    <!-- 20131223-购物车-start -->
    <div class="sc-list">
    	<!-- 20131223-购物车-商品列表-start -->
    	<div class="sc-pro-list">

            <!-- 20131223-订单-商品-标题-start -->
            <div class="sc-pro-title-area <?php if(empty($data)){?>
                 hide 
               <?php }?>">
                <div class="h">
                    <table border="0" cellpadding="0" cellspacing="0">
                        <thead>
                            <tr>
                                <th class="tr-check">
                                	<!--<input id="checkAll-top" class="vam checkAll" autocomplete="off" type="checkbox" onclick="selectAll();">-->
                                </th>
                                <th class="tr-pro">商品</th>
                                <th class="tr-price">单价<em>（元）</em></th>
                                <th class="tr-quantity">数量</th>
                                <th class="tr-subtotal">小计<em>（元）</em></th>
                                <th class="tr-operate">操作</th>
                            </tr>
                        </thead>
                    </table>
                </div>
            </div>
            <!-- 20131223-订单-商品-标题-end -->
		<form id="cart-form">

			<?php foreach ($data as $k=>$v){?>
			<span id="cart-list"><!--product-list start-->
				<div class="sc-pro-area selected" id="order-pro-8943">
					<table border="0" cellpadding="0" cellspacing="0">
						<tbody>
							<tr class="sc-pro-item">
							<td rowspan="1" class="tr-check">
								<input  type="checkbox" class="checkbox checkAll" name="session_gid" value="<?php echo $k?>">
								<p class="timerpromo-8943 hide"></p>
							</td>
							<td class="tr-pro">
									<div class="pro-area clearfix">
										<p class="p-img">
											<a title="" target="_blank" href="" seed="cart-item-name">
												<img alt="" src="<?php echo $v['options']['img']?>">
											</a>
										</p>
										<p class="p-name">
											<a title="" target="_blank" href="" seed="cart-item-name"><?php echo $v['name']?>
												<?php foreach ($v['vdata'] as $vv){?>
												&nbsp;<?php echo $vv['gtvalue']?>&nbsp;
												<?php }?>
											</a>
										</p>
										<p class="p-sku">
											<?php foreach ($v['vdata'] as $vv){?>
											<em><?php echo $vv['taname']?>：<?php echo $vv['gtvalue']?></em>
                                            <?php }?>
										</p>
										<p class="understock-8943 hide"></p>
									</div>
							</td>
							<td class="tr-price"><span><?php echo $v['price']?></span></td>
								<td class="tr-quantity" rowspan="1">
									<div class="sc-stock-area">
										<div class="stock-area">
											<a href="javascript:;" class="icon-minus-3 vam" title="减"><span>-</span></a>
											<input style="ime-mode: disabled;" id="quantity-8943" class="shop-quantity textbox vam" value="<?php echo $v['num']?>" type="text">
											<a href="javascript:;" class="icon-plus-3 vam" title="加"><span>+</span></a>
										</div>
									</div>
									
								</td>
								<td rowspan="1" class="tr-subtotal">
									<b>¥<?php echo $v['total']?></b>
								</td>
								<td rowspan="1" class="tr-operate">
									<a href="javascript:;" class="icon-sc-del" CartKey="<?php echo $k?>" title="删除">删除</a>
								</td>
								
								
						</tr>
						</tbody>
					</table>
				</div><!--product-list end-->
			
			</span>
			<?php }?>
		</form>
    </div>
    	
    	
    	<div class="hr-20"></div>
    	<div id="cart-total-area" class="sc-total-area clearfix">
    		<div class="sc-total-control">
    			<input id="checkAll-buttom" name="" class="vam"  autocomplete="off" type="checkbox">
    			<label class="vam" for="checkAll-buttom">全选</label>
    			<a class="vam" href="javascript:;" seed="cart-all-del">删除选中商品</a>
    		</div>
    		<div class="sc-total-price">
    			<table border="0" cellpadding="0" cellspacing="0">
    				<tbody>
    					<tr>
    						<th>
    							<em>合计(不含运费)：<em></em></em>
    						</th>
    						<td>
    							<b id="sc-cartInfo-totalPrice">¥1599.00</b>
    						</td>
    					</tr>
    				</tbody>
    			</table>
    		</div>
    	</div>
    	
    	<div class="hr-25"></div>
    	<div class="sc-action-area clearfix">
    		<a class="button-style-4 button-go-shopping-3" href="index.php">继续购物</a>
    		<a class="button-style-1 button-go-checkout-2" href="javascript:;" >去结算</a>
    	</div>
		<!--购物车-商品列表 end -->
    </div>
        <script type="text/javascript">
    		//全选、单选	
    	    $('#checkAll-buttom').click(function(){
    	    	var checked=$(this).is(':checked');
  	    	    $(':checkbox').prop('checked',checked);
    	    });
    		
    	</script>
    
    <div class="hr-35"></div>
     <!--购物车-空数据 --> 
        <div style="text-align: center;" id="cart-empty-msg" class="sc-empty-area ">
            亲，您购物车里还没有物品哦，快去逛逛吧！
        </div>
        <!-- 购物车列表 End-->
        <script type="text/javascript">
        	$(function(){
        		if($('.sc-pro-title-area').hasClass('hide')){
        			$('.sc-total-area').addClass('hide');
        			$('.sc-action-area').addClass('hide');
        			$('.sc-empty-area').removeClass('hide');
                   
        		}else{
        			$('.sc-total-area').removeClass('hide');
        			$('.sc-action-area').removeClass('hide');
        			$('.sc-empty-area').addClass('hide');
        			
        			var total=0;
        			$('.tr-subtotal b').each(function(){
        				total=total+parseInt($(this).text().replace('¥',''));
        				
        			});

        			$('#sc-cartInfo-totalPrice').text('¥'+total);
        			
                        //异步删除购物车商品
						$('.icon-sc-del').click(function(){
							$(this).closest('#cart-list').remove();
							var CartId=$(this).attr('CartKey');
							$.ajax({
								type:"get",
								url:"<?php echo U('Cart/delOne')?>",
								data:{'CartId':CartId},
								dataType:'json',
								success:function(data){
									
									if(data==1){
										hd_alert({message:'删除成功！'});
									}
								}
							});
							
						});
						
					
						
				    $('.button-go-checkout-2').click(function(){
				    	
				    	var GcId='';
				    	var checkedAll=$('.checkAll:checked');
				    	
				    	$.each(checkedAll, function(){
				    		
				    	     GcId+=$(this).val()+',';
				    	
				    	});
				    	
				    	if(GcId==''){
				    		hd_alert({message:'请选择购物车商品！'});
				    		return;
				    	}else{
				    		
				    		location.href="<?php echo U('Order/index')?>"+"&GcId="+GcId.substring(0,GcId.length-1);
				    		
				    	}
				    	
				    })		
						
						
		
        		}
        	});
        </script>
        
        

    <!-- 购物车主体 End　-->
</div>
<div class="hr-75"></div>
<!--口号-20121025 -->
<div class="slogan">
	<ul>
		<li class="s1"><i></i>500强企业&nbsp;品质保证</li>
		<li class="s2"><i></i>7天退货&nbsp;15天换货</li>
		<!-- <li class="s3"><i></i>99元起免运费</li> -->
		<li class="s3"><i></i>
			<span>99元起免运费</span>
</li>
		<li class="s4"><i></i>448家维修网点&nbsp;全国联保</li>
	</ul>
</div>
<!--口号-end -->

<footer class="footer">
    <!-- 20130902-底部-友情链接-start -->
	<div class="footer-otherLink">
		<p style="text-align:left;">友情链接：  | 
			<a href="http://www.huawei.com/cn/" target="_blank">华为官网</a>  |
			
	</div>
	<div class="footer-warrant-area"><p><a textvalue="隐私政策" title="隐私政策" target="_blank" href="./Public/Home/image/20160226162651249.png" title="公安备案" border="0" height="20" hspace="0" vspace="0" width="20"><span style="font-size:15px;font-family:宋体"><span style="font-size:12px;font-family:arial,helvetica,sans-serif;"> 苏公网安备</span><span style="font-size:12px;font-family:arial,helvetica,sans-serif;"> 32011402010009号</span></span></a> | <a target="_blank" href="http://www.miitbeian.gov.cn/">苏ICP备09062682号-9</a> | 增值电信业务经营许可证：苏B2-20130048 | <a target="_blank" href="http://res.vmallres.com/certifi./Public/Home/image/wwwz.jpg">网络文化经营许可证：苏网文[2012]0401-019号</a></p><p><br><a target="_blank" href="http://res.vmallres.com/certifi./Public/Home/image/wwwz.jpg"></a></p><p><a target="_blank" href="http://www.jsgsj.gov.cn:60103/businessCheck/verifKey.do?serial=320100913201147770231720001001-SAIC_SHOW_32000020160129102316602&signData=MEUCIQDjstcg6fPylz+uES4LNTcBpBVlZujS8l5erIgXiDGw1QIgfHZFK11kZ1vB2enLCwvaslyfE1fztpB19AEK4hlwibo="><img src="./Public/Home/image/20160226162415360.png" style="float:none;width:90px;height:32px;" title="电子营业执照" border="0" height="32" hspace="0" vspace="0" width="90"></a>   <a target="_blank" href="https://ss.knet.cn/verifyseal.dll?sn=e13010932010038497pwz6000000&trustKey=dn&trustValue=vmall.com"><img style="width:90px;height:32px;float:none;" src="./Public/Home/image/20160226162521265.png" title="可信网站" border="0" height="32" hspace="0" vspace="0" width="90"></a>   <a target="_blank" href="https://search.szfw.org/cert/l/CX20121017001773002082"><img style="width:90px;height:32px;float:none;" src="./Public/Home/image/20160226162531395.png" title="诚信网站" border="0" height="32" hspace="0" vspace="0" width="90"></a></p></div><!--授权结束 --><script>
</footer>

</body>

</html>
